//
//  Status.swift
//  JMWB
//
//  Created by 个人电脑 on 16/3/21.
//  Copyright © 2016年 个人电脑. All rights reserved.
//

import UIKit

class Status: NSObject {
    //微博创建时间
    var created_at : String?
    //微博id
    var id : Int = 0
    //微博来源"<a href=\"http://app.weibo.com/t/feed/310OQS\" rel=\"nofollow\">精彩微客</a>"
    var source : String?
    //微博正文
    var text : String?
    //用户属性
    var user : User?
    //图片URl
    var pic_urls : [[String : AnyObject]]?
    //转发微博
    var retweeted_status : Status?
            
   init(dict :[String : AnyObject]) {
        super.init()
        setValuesForKeysWithDictionary(dict)
    //将用户字典转成用户模型对象
    if let userDict = dict["user"] as? [String : AnyObject]{
    user = User(dict: userDict)
    }
    //将转发微博的字典转成模型对象
    if let retweetedStatusDict = dict["retweeted_status"] as? [String : AnyObject]{
    retweeted_status = Status(dict: retweetedStatusDict)
    }
}

    override func setValue(value: AnyObject?, forUndefinedKey key: String) {}
}
